package indi.kider.server.bill.service.related;

import indi.kider.common.model.bill.Meter;
import indi.kider.common.model.meter.CommandResponse;
import indi.kider.common.model.meter.InstantCommand;
import indi.kider.common.model.meter.MeterReading;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import pers.vankid.common.model.base.CommonResponse;

/**
 * Created by shixj on 2018/5/28.
 */
@FeignClient(value = "meter")
public interface MeterClientService {
    /**
     * 内部服务
     * 读日冻结数据
     *
     * @param meterReading
     * @return
     */
    @PostMapping("reading")
    CommonResponse<MeterReading> getDayReading(@RequestBody MeterReading meterReading);

    /**
     * 抄水表
     *
     * @param command
     * @return
     */
    @PostMapping("water/reading")
    CommonResponse<MeterReading> readWaterMeter(@RequestBody InstantCommand command);

    /**
     * 抄电表
     *
     * @param command
     * @return
     */
    @PostMapping("power/reading")
    CommonResponse<MeterReading> readPowerMeter(@RequestBody InstantCommand command);

    /**
     * 发送命令（拉合闸）
     *
     * @param command
     * @return
     */
    @PostMapping("command")
    CommonResponse<CommandResponse> sendCommand(@RequestBody InstantCommand command);
    /**
     * 获取表档案
     *
     * @param meter
     * @return
     */
    @PostMapping("document")
    CommonResponse<Meter> getMeterDocument(@RequestBody Meter meter);
}
